package com.bjsxt.mapper;

import com.bjsxt.pojo.Admin;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.sql.Date;
import java.util.List;

public interface AdminMapper {

    //查询用户登录
    @Select("select * from t_admin where aname=#{param1} and apwd=#{param2}")
    Admin selectAdmin(String aname,String apwd);

    //分页查询所有
    @Select("select * from t_admin")
    List<Admin> selectAdminAll();

    //添加管理员

    Integer insertAdmin(Admin admin);

    //修改管理员
    @Update("update t_admin set aname=#{aname},apwd=#{apwd},aphone=#{aphone} where aid=#{aid}")
    Integer updateAdmin(Admin admin);

    //删除管理员
    @Delete("delete from t_admin where aid=#{param1}")
    Integer deleteAdmin(Integer aid);


}
